package com.xysq.fragment;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.rockcent.model.Topics;
import com.xysq.lemon.R;

import butterknife.InjectView;

/**
 * Created by huangdongkai on 2015/7/29.
 */
public class IntroduceFragment extends BaseFragment {
    @InjectView(R.id.txt_ticket_count)
    TextView ticketCountTxt;
    @InjectView(R.id.txt_click_count)
    TextView clickCountTxt;
    @InjectView(R.id.txt_customer_name)
    TextView nameTxt;
    @InjectView(R.id.txt_introduce)

    TextView introduceTxt;
    private int count;
    private Topics topics;

    @SuppressLint("ValidFragment")
    public IntroduceFragment(int count,Topics topics) {
        this.count = count;
        this.topics = topics;
    }

    public IntroduceFragment(){}

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflaterView(inflater, R.layout.fragment_introduce, null);
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        ticketCountTxt.setText(count + getResources().getString(R.string.txt_ticket_count));
        clickCountTxt.setText(topics.getViewCount() + getResources().getString(R.string.txt_click_count));
        nameTxt.setText(topics.getName());
        introduceTxt.setText(topics.getIntroduction());
    }
}
